<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <script>
        let Q = 0
        while (true) {
            let choice = prompt(`
                请你选择操作：
                1,存钱
                2,取钱
                3,查看余额
                4,退出
            `)
            if (choice == 4) {
                break;
            } else {
                switch (choice) {
                    case '1':
                        Q += +prompt(`请输入存钱金额：`)
                        alert('钱已经存进去啦~')
                        break
                    case '2':
                        Q -= +prompt(`请输入取钱金额：`)
                        alert('钱已经取走啦~')
                        break
                    case '3':
                        alert(`你还有${Q}元`)
                        break
                }
            }
        }

    </script>
</body>

</html>